package com.tools;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.Action;
import javax.swing.JButton;

import com.tools.BICButtonRuban.RubanMouseListener;

public class BICButtonOnglet extends JButton{

	private static final long serialVersionUID = 1L;

	public BICButtonOnglet() {
		super();
		this.addMouseListener(new OngletMouseListener());
		this.setBackground(BICStyle.getColorWhite());
		this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		this.setForeground(Color.WHITE);
		this.setFont(BICStyle.getFontOnglet());
	}

	public BICButtonOnglet(String text) {
		super(text);
		this.addMouseListener(new OngletMouseListener());
		this.setBackground(BICStyle.getColorWhite());
		this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		this.setForeground(Color.WHITE);
		this.setFont(BICStyle.getFontOnglet());
	}

	public BICButtonOnglet(Action action) {
		super(action);
		this.addMouseListener(new OngletMouseListener());
		this.setBackground(BICStyle.getColorWhite());
		this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		this.setForeground(Color.WHITE);
		this.setFont(BICStyle.getFontOnglet());
	}

	public class OngletMouseListener extends MouseAdapter {
		public void mouseClicked(MouseEvent e) {
		}

		public void mousePressed(MouseEvent e) {
		}

		public void mouseReleased(MouseEvent e) {
		}

		public void mouseEntered(MouseEvent e) {
			((BICButtonOnglet) e.getSource()).setBackground(BICStyle.getColorGrisClair());
		}

		public void mouseExited(MouseEvent e) {
			((BICButtonOnglet) e.getSource()).setBackground(BICStyle.getColorWhite());
		}
	}
}
